# 游戏入口
from source import tools
from source.states import main_menu, load_screen, level

def main():

    state_dict = {  # 将各个状态写成一个字典, 实例化
        'main_menu': main_menu.MainMenu(),
        'load_screen': load_screen.LoadScreen(),
        'level': level.Level(),
        'game_over': load_screen.GameOver()
    }
    # 通过Game类初始了一个game实例
    game = tools.Game(state_dict, 'main_menu')
    # state = main_menu.MainMenu()  # 初始化主菜单界面
    # state = load_screen.LoadScreen()
    # state = level.Level
    game.run()

# 让代码被当做脚本执行的时候才运行里面的main函数
if __name__ == '__main__':
    main()